import { Tuple } from "./Tuple";

export class Layer extends Tuple {
    constructor(name) {
        super();
        this.type = "Layer"
        this.name = name;
        this.cesiumLayer = null;
    }
    set show(value) {
        this.cesiumLayer.show = value;
    }
    get show() {
        return this.cesiumLayer.show;
    }

    //添加到指定的map中
    _addToMap(map) {
        throw new Error("请实现该方法");
    }
    //从map中移除
    _removeByMap(destroy) {
        throw new Error("请实现该方法");
    }
    _flyTo(duration = 3, pitch = -90, heading = 0, range = 0, maximumHeight) {
        this.map.viewer.flyTo(this.cesiumLayer, {
            maximumHeight: maximumHeight,
            duration: duration,
            offset: {
                heading: Cesium.Math.toRadians(heading),
                pitch: Cesium.Math.toRadians(pitch),
                range: range
            }
        });
        return this;
    }
}
